import FResponseForm from './src/response-form.component';
import FResponseFormDesign from './src/designer/response-form.design.component';
import FDynamicFormGroup from './src/component/dynamic-form-group/dynamic-form-group.component';
import FDynamicFromGroupDesign from './src/designer/form-group.design.component';
import { formGroupPropsResolver } from './src/component/dynamic-form-group/dynamic-form-group.props';
import { formPropsResolver } from './src/response-form.props';
import { App } from 'vue';

export * from './src/types';
export * from './src/composition/types';
export * from './src/response-form.props';
export * from './src/component/dynamic-form-group/dynamic-form-group.props';

export { FResponseForm, FDynamicFormGroup };

export default {
    install(app: App): void {
        app.component(FResponseForm.name, FResponseForm)
            .component(FDynamicFormGroup.name, FDynamicFormGroup);
    },
    register(componentMap: Record<string, any>, propsResolverMap: Record<string, any>): void {
        componentMap['form-group'] = FDynamicFormGroup;
        propsResolverMap['form-group'] = formGroupPropsResolver;
        componentMap['response-form'] = FResponseForm;
        propsResolverMap['response-form'] = formPropsResolver;
    },
    registerDesigner(componentMap: Record<string, any>, propsResolverMap: Record<string, any>): void {
        componentMap['form-group'] = FDynamicFromGroupDesign;
        propsResolverMap['form-group'] = formGroupPropsResolver;
        componentMap['response-form'] = FResponseFormDesign;
        propsResolverMap['response-form'] = formPropsResolver;
    }
};
